﻿using DevComponents.DotNetBar;
using Kimd.Common;
using Kimd.Machine;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WorkStation.Common;

namespace WorkStation.UI
{
    public partial class FormLimitSetting : Office2007Form
    {
        private string _axisName;
        public FormLimitSetting(string axisName)
        {
            InitializeComponent();
            this.EnableGlass = false;
            this._axisName = axisName;
        }

        private void FormLimitSetting_Load(object sender, EventArgs e)
        {
            motionLimitControl1.SetAxis(_axisName);
            motionLimitControl1.LoadLimit();
        }

        private void btn_Save_Click(object sender, EventArgs e)
        {
            if(!motionLimitControl1.Verify())
            {
                return;
            }

            MachineResource.Instance.Save(Properties.Settings.Default.ConfigName);
            SystemInfo.ShowToastInfo(this, "保存配置成功!", false);
        }
    }
}
